<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="commons/taglibs.jsp" %>
<!DOCTYPE html>
<!-- saved from url=(0026)http://sell.fqapps.com/reg -->
<html class="js cssanimations"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <title>注册账号-一折微信淘客系统</title>

    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/amazeui.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/admin.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/style.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/assets/css/login.css"/>

    <!--[if (gte IE 9)|!(IE)]><!-->
    <script type="text/javascript" src="${ctx}/assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="${ctx}/assets/js/fastclick.min.js"></script>
    <script>$(function() {FastClick.attach(document.body);});</script>
    <!--<![endif]-->

    <script type="text/javascript" src="${ctx}/assets/js/amazeui.min.js"></script>


</head>


<body>
<%@ include file="commons/dialog.jsp" %>
<script>
    var ctx = "${ctx}";

    $(function() {

        $('#authcodeimg').attr("src", "${ctx}/authimage/verifycode.do?id=?"+Math.random());

        $('#authcodeimg').on('click', function() {
            $(this).attr("src", "${ctx}/authimage/verifycode.do?id=?"+Math.random());
        });

        $('#verifyCode').keypress(function(event){
            var keycode = (event.keyCode ? event.keyCode : event.which);
            if(keycode == '13'){
                $('#submit').click();
            }
        });

        $('#sendsms').on('click', function() {
            var mobile = $('#mobile').val();
            var verifyCode = $('#verifyCode').val();

            if(mobile == ""){
                $("#fq_alert_info").html("手机号不能为空！");
                $('#fq_alert').modal({});
                return
            }
            if(verifyCode == ""){
                $("#fq_alert_info").html("验证码不能为空！");
                $('#fq_alert').modal({});
                return
            }
            $.post("${ctx}/user/sendSms.do",{mobile:mobile,verifyCode:verifyCode},function(result){
                if(result.code == 200){
                    $("#sendsms").text('已发送');
                    $("#sendsms").attr("disabled","disabled");
                }else{
                    $("#fq_alert_info").html(result.message);
                    $('#fq_alert').modal({closeViaDimmer:false});
                    if(result.code == 0){
                        $('#verifyCode').val("");
                        $('#authcodeimg').attr("src", "${ctx}/authimage/verifycode.do?id=?"+Math.random());
                    }
                }
            });
        });

        $('#submit').on('click', function() {
            var mobile = $('#mobile').val();
            var password = $('#password').val();
            var repassword = $('#repassword').val();
            var smsCode = $('#smsCode').val();
            var verifyCode = $('#verifyCode').val();
            var qq = $('#qq').val();
            var __hash__ = $("input[name='__hash__']").val();
            
            if(mobile == ""){
                $("#fq_alert_info").html("手机号不能为空！");
                $('#fq_alert').modal({});
                return
            }

            if(verifyCode == ""){
                $("#fq_alert_info").html("验证码不能为空！");
                $('#fq_alert').modal({});
                return
            }
            
            if(smsCode == ""){
                $("#fq_alert_info").html("短信验证码不能为空！");
                $('#fq_alert').modal({});
                return
            }

            if(qq == ""){
                $("#fq_alert_info").html("QQ不能为空！");
                $('#fq_alert').modal({});
                return
            }

            if(password == "" || repassword == ""){
                $("#fq_alert_info").html("密码不能为空！");
                $('#fq_alert').modal({});
                return
            }

            if(repassword != password){
                $("#fq_alert_info").html("两次输入密码不同！");
                $('#fq_alert').modal({});
                return
            }
            
            /* $.ajax({
                type : "post",
                dataType : "json",
                url : "${ctx}/user/register.do",
                data : $("#form").serialize(),
                success : function(json) {
                    if(json.code==200){
                    	alert("注册成功");
                        $("#fq_alert_info").html("注册成功");
                    }else{
                    	alert("注册失败");
                        $("#fq_alert_info").html("注册失败");
                    }
                }
            });  */

             $.post("${ctx}/user/register.do",{mobile:mobile,password:password,smsCode:smsCode,verifyCode:verifyCode,qq:qq,from_sid:0},function(result){
            	 if(result.code == 200){
                    $("#fq_confirm_info").text(result.message);
                    $('#fq_confirm').modal({closeViaDimmer:false,relatedTarget: this,onConfirm: function(options) {
                        window.location.href="${ctx}/user/loginPage.do";
                    },onCancel: function() {}
                    });
                }else{
                    $("#fq_alert_info").html(result.message);
                    $('#fq_alert').modal({closeViaDimmer:false});
                }
            }); 

        });


    });

</script>

<header class="sso_header">
    <a href="" class="logo"></a>
</header>

<section class="content_box">
    <div class="am-form am-form-horizontal" method="post" data-am-validator="" novalidate="novalidate">

        <div class="am-form-group">
            <div class="am-u-sm-12">
                <input type="number" placeholder="输入您的手机" name="mobile" id="mobile" required pattern="^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$">
            </div>
        </div>

        <div class="am-form-group">
            <div class="am-u-sm-8">
                <input type="text" placeholder="输入验证码" name="verifyCode" id="verifyCode" required>
            </div>
            <div class="am-u-sm-4 am-padding-left-0">
                <img class="authcodeimg" id="authcodeimg" src="" style="cursor: pointer;">
            </div>
        </div>

        <div class="am-form-group">
            <div class="am-u-sm-8">
                <input type="text" placeholder="短信验证码" name="smsCode" id="smsCode" required>
            </div>
            <div class="am-u-sm-4 am-padding-left-0">
                <button id="sendsms" class="am-btn am-btn-success am-btn-block am-text-xs" style="line-height: 23px;">获取验证码</button>
            </div>
        </div>

        <div class="am-form-group">
            <div class="am-u-sm-12">
                <input type="number" placeholder="联系QQ" name="qq" id="qq" required pattern="^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$">
            </div>
        </div>

        <div class="am-form-group">
            <div class="am-u-sm-12">
                <input type="password" placeholder="设置密码" name="password" id="password" required>
            </div>
        </div>

        <div class="am-form-group">
            <div class="am-u-sm-12">
                <input type="password" placeholder="重复密码" id="repassword" required>
            </div>
        </div>

        <div class="am-form-group">
            <div class="am-u-sm-12 ">
                <button id="submit" class="am-btn am-btn-primary am-btn-block">注册</button>
            </div>
        </div>

        <h5 class="reg_now">已有帐号？<a href="${ctx}/user/loginPage.do">立即登陆</a></h5>

    </div>
</section>

<footer>
    <div class="slogan">— 微信淘客盈利助手 —</div>
    <div style="color: #d1d1d1;" class="am-text-sm am-margin-top-xs am-text-center"> 深圳前海刷云科技有限公司  CopyRight©2016  闽ICP备16026055号</div>
</footer>

<!-- <div class="am-hide"><script src="./注册账号_files/z_stat.php" language="JavaScript"></script><script src="./注册账号_files/core.php" charset="utf-8" type="text/javascript"></script><a href="" target="_blank" title="站长统计">站长统计</a></div> -->
</body></html>
